Symbols

Symbols are objects whose usefulness rests on the fact that two symbols are identical (in the sense of <#497#>eqv?<#497#>) if and only if their names are spelled the same way. This is exactly the property needed to represent identifiers in programs, and so most implementations of Scheme use them internally for that purpose. Symbols are useful for many other applications; for instance, they may be used the way enumerated values are used in Pascal.

The rules for writing a symbol are exactly the same as the rules for writing an identifier; see sections~#syntaxsection#499> and~#identifiersyntax#500>.

It is guaranteed that any symbol that has been returned as part of a literal expression, or read using the <#501#>read<#501#> procedure, and subsequently written out using the <#502#>write<#502#> procedure, will read back in as the identical symbol (in the sense of <#503#>eqv?<#503#>). The <#2054#>string<#504#><#504#>symbol<#2054#> procedure, however, can create symbols for which this write/read invariance may not hold because their names contain special characters or letters in the non-standard case.


#note505#


#entry507#


#entry516#


#entry529#